package stringdemo;

public class StringDemo8PhoneNumberConceal {
    public static void main(String[] args) {
    /*
    substring(int beginIndex,int endIndex)   截取
    注意点：包头不包尾，包左不包右
          只有返回值才是截取的小串
    substring(int endIndex)   截取末尾
     */

        //1.获取一个手机号码
        String phoneNumber = "13623141206";

        //2.截取手机号的前三位(start)
        String start = phoneNumber.substring(0,3);
        //3.截取手机的后四位
        String end = phoneNumber.substring(7);
        //4.拼接
        String result = start + "****" + end;
        //5.打印
        System.out.println(result);
    }
}
